/*
 * Tencent is pleased to support the open source community by making ovCompose available.
 * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.tencent.compose.sample.mainpage

import com.tencent.compose.sample.Compose1500Text
import com.tencent.compose.sample.PreviewAppTabScreen
import com.tencent.compose.sample.data.DisplayItem
import com.tencent.compose.sample.data.DisplaySection
import com.tencent.compose.sample.mainpage.material3.ButtonDemo
import com.tencent.compose.sample.mainpage.material3.CardDemo
import com.tencent.compose.sample.mainpage.material3.CheckboxDemo
import com.tencent.compose.sample.mainpage.material3.ListItemDemo
import com.tencent.compose.sample.mainpage.material3.SimpleTab
import com.tencent.compose.sample.mainpage.material3.SliderDemo
import com.tencent.compose.sample.mainpage.material3.SurfaceDemo
import com.tencent.compose.sample.mainpage.material3.SwitchDemo
import com.tencent.compose.sample.mainpage.material3.TextButtonDemo
import com.tencent.compose.sample.mainpage.material3.TextDemo
import com.tencent.compose.sample.mainpage.material3.TextFieldDemo
import com.tencent.compose.sample.mainpage.sectionItem.BottomAppBarDemo
import com.tencent.compose.sample.mainpage.sectionItem.BouncingBallsApp
import com.tencent.compose.sample.mainpage.sectionItem.CanvasDemo
import com.tencent.compose.sample.mainpage.sectionItem.CarouselTransition
import com.tencent.compose.sample.mainpage.sectionItem.CheckboxExamples
import com.tencent.compose.sample.mainpage.sectionItem.ComposeLazy1500Image
import com.tencent.compose.sample.mainpage.sectionItem.DialogExamples
import com.tencent.compose.sample.mainpage.sectionItem.ImageExamplesScreen
import com.tencent.compose.sample.mainpage.sectionItem.LazyLayoutDemo
import com.tencent.compose.sample.mainpage.sectionItem.LazyRowDemo
import com.tencent.compose.sample.mainpage.sectionItem.ProgressIndicatorExamples
import com.tencent.compose.sample.mainpage.sectionItem.San
import com.tencent.compose.sample.mainpage.sectionItem.ScaffoldDemo
import com.tencent.compose.sample.mainpage.sectionItem.SimpleImage
import com.tencent.compose.sample.mainpage.sectionItem.SimpleTextPage
import com.tencent.compose.sample.mainpage.sectionItem.SliderExamples
import com.tencent.compose.sample.mainpage.sectionItem.SwitchExamples
import com.tencent.compose.sample.mainpage.sectionItem.TabDemo
import com.tencent.compose.sample.mainpage.sectionItem.TopAppBarDemo
import com.tencent.compose.sample.mainpage.sectionItem.composeView1500Page
import composesample.composeapp.generated.resources.Res
import composesample.composeapp.generated.resources.balls
import composesample.composeapp.generated.resources.carousel
import composesample.composeapp.generated.resources.cat
import composesample.composeapp.generated.resources.checkbox
import composesample.composeapp.generated.resources.dialog
import composesample.composeapp.generated.resources.dog
import composesample.composeapp.generated.resources.gradient
import composesample.composeapp.generated.resources.progress
import composesample.composeapp.generated.resources.simple_text
import composesample.composeapp.generated.resources.sliders
import composesample.composeapp.generated.resources.switch
import composesample.composeapp.generated.resources.text_field
import org.jetbrains.compose.resources.ExperimentalResourceApi

@OptIn(ExperimentalResourceApi::class)
internal fun displaySections(): List<DisplaySection> {
    return listOf(
        DisplaySection(
            sectionTitle = "Compose Component",
            items = listOf(
                DisplayItem("dialog", Res.drawable.dialog) { DialogExamples() },
                DisplayItem("switch", Res.drawable.switch) { SwitchExamples() },
                DisplayItem("sliders", Res.drawable.sliders) { SliderExamples() },
                DisplayItem("checkbox", Res.drawable.checkbox) { CheckboxExamples() },
                DisplayItem("progress", Res.drawable.progress) { ProgressIndicatorExamples() },
                DisplayItem("simple-text", Res.drawable.simple_text) { SimpleTextPage() },
                DisplayItem("image-cat", Res.drawable.cat) { SimpleImage() },
                DisplayItem("image-dog", Res.drawable.dog) { ImageExamplesScreen() },
                DisplayItem("carousel", Res.drawable.carousel) { CarouselTransition() },
                DisplayItem("scaffold", Res.drawable.text_field) { ScaffoldDemo() },
                DisplayItem("Tab", Res.drawable.text_field) { TabDemo() },
                DisplayItem("TopAppBar", Res.drawable.text_field) { TopAppBarDemo() },
                DisplayItem("BottomAppBar", Res.drawable.text_field) { BottomAppBarDemo() },
                DisplayItem("Canvas", Res.drawable.text_field) { CanvasDemo() },
                DisplayItem("LazyRow", Res.drawable.text_field) { LazyRowDemo() },
                DisplayItem("LazyLayout", Res.drawable.text_field) { LazyLayoutDemo() },
            )
        ),
        DisplaySection(
            sectionTitle = "material3",
            items = listOf(
                DisplayItem("Text", Res.drawable.text_field) { TextDemo() },
                DisplayItem("Slider", Res.drawable.text_field) { SliderDemo() },
                DisplayItem("Card", Res.drawable.text_field) { CardDemo() },
                DisplayItem("Button", Res.drawable.text_field) { ButtonDemo() },
                DisplayItem("TextButton", Res.drawable.text_field) { TextButtonDemo() },
                DisplayItem("Surface", Res.drawable.text_field) { SurfaceDemo() },
                DisplayItem("Checkbox", Res.drawable.text_field) { CheckboxDemo() },
                DisplayItem("Tab", Res.drawable.text_field) { SimpleTab() },
                DisplayItem("ListItem", Res.drawable.text_field) { ListItemDemo() },
                DisplayItem("Switch", Res.drawable.text_field) { SwitchDemo() },
                DisplayItem("TextField", Res.drawable.text_field) { TextFieldDemo() },
            )
        ),
        DisplaySection(
            sectionTitle = "Dfx",
            items = listOf(
                DisplayItem("Sanitizers", Res.drawable.balls) { San() },
            )
        ),
        DisplaySection(
            sectionTitle = "Benchmark",
            items = listOf(
                DisplayItem("Bouncing Balls", Res.drawable.balls) { BouncingBallsApp() },
                DisplayItem("1500view", Res.drawable.text_field) { composeView1500Page() },
                DisplayItem("1500text", Res.drawable.text_field) {  Compose1500Text() },
                DisplayItem("1500image", Res.drawable.text_field) { ComposeLazy1500Image() },
                DisplayItem("帖子列表", Res.drawable.gradient) { PreviewAppTabScreen() }
            )
        )
    )
}

internal expect fun platformSections() : List<DisplayItem>
